<template>
    <view class="g_content">
        <view class="dis_f_c_c p_t_20">
        <image :src="infoData.pictureUrl"   style="width: 500rpx;height: 550rpx"></image>
        </view>
<!--        <u-swiper width="100%" imgMode="widthFix" radius="0" :list="swiperList" @click="handleShowImg"></u-swiper>-->

<!--        <swiper class="swiper-box" indicator-dots autoplay circular>
            <swiper-item v-for="(item, i) in swiperList" :key="i" @click="handleShowImg">
                <image style="width: 100%" :src="item" mode="widthFix" />
            </swiper-item>
        </swiper>-->
        <view class="p_20">
            <view class="dis_f_w_l">
                <view class="f_s_18 m_r_5 m_t_10">{{infoData.name}}</view>
                <view class="m_l_5 m_r_5 m_t_10">{{infoData.age}}岁</view>
                <view class="m_t_10">
                    <u-tag v-if="infoData.sex==1" text="女" icon="woman" size="mini" type="error"></u-tag>
                    <u-tag v-else text="男" icon="man" size="mini" ></u-tag>
                </view>
                <view class="m_l_10 m_t_10">
                    <u-tag :text="infoData.helpType"  size="mini" type="success"></u-tag>
                </view>
                <view class="m_l_10 m_t_10">
                    <u-tag :text="infoData.helpNeeds"  size="mini" type="warning"></u-tag>
                </view>
            </view>
            <div class="dis_f_l_c m_t_10">
               <u-icon name="map" size="20"></u-icon>
                {{infoData.area}}{{infoData.street}}{{infoData.community}}
            </div>
            <view class="card_box p_10 m_t_10">
               <view class="line_title">微心愿</view>
                <view class="m_t_20">{{infoData.wish}}</view>
            </view>
            <view class="card_box p_10 m_t_10">
               <view class="line_title">家庭情况</view>
                <view class="m_t_20">{{infoData.familyInfo}}</view>
            </view>
        </view>
        <!-- 授权弹窗 -->
        <s-auth-modal />
    </view>
</template>

<script>
import { getOrphanInfoApi } from "@/sheep/api";

export default {
    name: "info",
    data() {
        return {
            swiperList: [],
            infoData:{
                configName:'张三',
                remark:'',
                url:''
            }
        }
    },
    onLoad(params) {
        this.userId = params.userId;
        this.getInfo();
        // this.swiperList = this.infoData.url.split(',');
    },
    methods:{
        getInfo(){
            getOrphanInfoApi(this.userId).then(res=>{
                this.infoData = res.data
                this.swiperList = res.data.pictureUrl.split(',');
            })
        },
        handleShowImg(){
            uni.previewImage({
                urls: this.swiperList,
                current: 0
            });
        }
    }
}
</script>

<style scoped lang="scss">
.swiper-box {
    width: 100%;
    height: 100vw;
}
</style>
